<?
class random{
	
	private $length;
	
	public function __construct($iLength){
		$this -> length = $iLength;
	}
	
	
	public function generateNext(){
	
		$alpha = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
		$num = array('0','1','2','3','4','5','6','7','8','9');
		
		$registerCode = '';
		
			for($i = 0; $i < $this -> length; $i++){
			
				$cAlpha	=	$alpha[rand(0,count($alpha)-1)];
				$cNum	=	$num[rand(0, count($num) -1)];
				
				
				$cArray = array($cAlpha, $cNum);
				
				$registerCode .= $cArray[rand(0,1)];
			
			
			
			}
			
			return $registerCode;
	
	
	}



}



?>